<template>
  <div id="app">
    <LoadDing />
    <router-view />
  </div>
</template>

<script setup lang="ts">
// 引入全局loadding
import LoadDing from "@/components/LoadDing.vue";
// 引入pinia 设置语言包
import { useSystemStore } from "@/stores/system";
const store = useSystemStore();

import { useI18n } from "vue-i18n";
const { t, locale } = useI18n();
// 设置语言包
locale.value = store.locale;

function qiehuan() {
  if (store.locale === "zh") {
    store.setLocale("en");
    locale.value = "en";
  } else {
    store.setLocale("zh");
    locale.value = "zh";
  }
}
</script>